﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="js/core.js"></script>
    <script>
        $(function () {
            var blog = $('#blog');

            var q = new DED.Queue;
            q.setRetryCount(5);
            q.setTimeout(10000);
            q.onFlush.subscribe(function (data) {
                var items = data.getElementsByTagName('item');
                for (var i = 0, len = items.length; i < len; i++) {
                    var title = items[i].getElementsByTagName('title')[0];
                    var link = items[i].getElementsByTagName('link')[0];
                    blog.append('<li><a href="' + link.firstChild.data + '">' + title.firstChild.data + '</a></li>');
                }
            });
            q.onFailure.subscribe(function () {
                blog.append('<p style="color:red;">Connection Error!</p>')
            });
            q.onComplete.subscribe(function () {
                blog.append('<p>Completed!</p>')
            });


            q.add({
                method: 'GET',
                uri: '../Factory_Pattern/FeedProxy.aspx?feed=http://weblogs.asp.net/scottgu/rss.aspx'
            });
            q.add({
                method: 'GET',
                uri: '../Factory_Pattern/FeedProxy.aspx?feed=http://weblogs.asp.net/scottgu/rss.aspx'
            });
            q.flush();
        });
    </script>
</head>
<body>
    <ul id="blog">

    </ul>
</body>
</html>
